package com.wanxi.map;

import jdk.nashorn.internal.ir.IdentNode;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class MyStreamMap {
    public static void main(String[] args) {
        Map<String, Integer> map = new HashMap<>();
        map.put("aaa", 1);
        map.put("aaaa", 2);
        map.put("aaaaa", 5);
        map.put("aaaaaa", 4);
        Stream<String> stream = map.keySet().stream().filter(s -> map.get(s) > 3);
        Map<Object, Object> collect = stream.collect(Collectors.toMap(s -> {
            System.out.println(s + " key ");
            return s;
        }, s -> {
            System.out.println(map.get(s) + " value ");
            return map.get(s);
        }));
        System.out.println(collect);
//        System.out.println(collect);
//        map.keySet().stream();
//        Stream.of(1,"1",true,"a");
    }
}
